<?php 
$path = '../';
include_once($path."common.php");


echo "[" ;

$sql_op_C = "select * from test " ;
$result_op_C = mysql_query($sql_op_C) ;
$row_op_C = mysql_fetch_object($result_op_C) ;
$total = mysql_num_rows($result_op_C) ;
for ($m=0 ; $m < mysql_num_rows($result_op_C); $m++){
$op_C01 = $row_op_C -> name ;
$op_C02 = $row_op_C -> value ;
if($m == $total-1){
echo "{" ;
echo "text:\"$op_C02\"," ;
echo "value:\"$op_C01\" " ;
echo "}" ;
}else{
echo "{" ;
echo "text:\"$op_C02\"," ;
echo "value:\"$op_C01\" " ;
echo "}," ;
}
$row_op_C = mysql_fetch_object($result_op_C) ;
}
echo "]" ;
?>